package com.ficus.road.maintain.service.smartnew;

import com.ficus.road.maintain.core.model.smart.HighwayDecision;
import com.ficus.road.maintain.core.model.smartnew.SmartDecision;
import org.springframework.stereotype.Service;

/**
 * @author xiawen yang
 * @date 2022/3/2 下午7:16
 */
@Service
public class SmartDecisionService {
    public HighwayDecision convert2HighwayDecision(SmartDecision smartDecision) {
        return HighwayDecision.builder()
                .id(smartDecision.getId())
                .road(smartDecision.getRoadName())
                .source(smartDecision.getSource())
                .bigType(smartDecision.getBigType())
                .roadType(smartDecision.getRoadCharacter())
                .pci(smartDecision.getPCI())
                .rqi(smartDecision.getRQI())
                .area(Double.parseDouble(smartDecision.getArea()))
                .investment(smartDecision.getMoney() / 10000)
                .rdi(smartDecision.getRDI())
                .pssi(smartDecision.getPSSI())
                .build();
    }
}
